import { requestPost, requestPostNoLogin } from '@/service/request'

/**登录
 * username 登录账号
 * password 登录密码
 */
export function Login(username:string, password:string) {
    return requestPostNoLogin({
        url: "/api/Login/Login",
        data: {
            AccountNo: username,
            Pwd: password,
            VerificationCode: "",
        }
    })
}

/**注册
 * username 登录账号
 * password 登录密码
 */
export function Register(username:string, password:string) {
    return requestPostNoLogin({
        url: "/api/Login/Register",
        data: {
            AccountNo: username,
            Pwd: password,
            VerificationCode: "",
        }
    })
}

/**获取用户列表
 * KeyWords 关键字查询
 */
export function GetUserList(KeyWords?:string) {
    return requestPost({
        url: "/api/OnLine/GetUserList",
        data: {
            KeyWords: KeyWords
        }
    })
}

/**获取聊天记录
 * userId 朋友ID
 */
export function GetOnLineMsgList(userId:string) {
    return requestPost({
        url: "/api/OnLine/GetOnLineMsgList",
        data: {
            Id:userId
        }
    })
}

/**发送消息
 * userId 朋友ID
 * Msg 消息
 */
export function SendMsg(userId:string,Msg:string) {
    return requestPost({
        url: "/api/OnLine/SendMsg",
        data: {
            Id:userId,
            Msg:Msg
        }
    })
}